function removeOne(id){
	layer.confirm("确定要删除该角色吗?",{icon: 4, title:'确认信息'},function(index){
		layer.close(index);
		var $form=$("<form>" );
		$form.attr( "style","display:none" ).attr( "target","").attr( "method","post" )
		.attr( "action", basepath + "/admin/role/del");
        var $id=$("<input>" ).attr("type" ,"hidden" ).attr("name" ,"id" ).attr("value" ,id);
		$form.append($id);
		$("body").append($form);
		$form.submit();
	},function(index){
		layer.close(index);
	});
}
function stopit(id,state){
	var msg = state==0?"停用":"启用";
	layer.confirm("确定要"+msg+"角色吗?",{icon: 4, title:'确认信息'},function(index){
		$.post(basepath+"/admin/role/stopit",{id:id,status:state},function(data){
			if(data.status==200){
				layer.msg("角色已"+msg+"！", function(){
					location.reload(true);
				});
			}
		}, "json");
	},function(index){
		layer.close(index);
	});
}
function authrize(id){
	window.layerIndex=layer.open({
	    type: 2,
	    title: '权限管理',
	    shadeClose: false,
	    shade: 0.8,
	    scrollbar:false,
	    area: ['380px', '70%'],
	    content: basepath+'/admin/role/fun?rid='+id
	}); 
}
function authFun(ids, rid){
	layer.close(layerIndex);
	var index = layer.msg('处理中，请稍后...', {icon: 16,shade: [0.5, '#393D49'],time:0});
	if(""==ids){
		layer.close(index);
		layer.msg("未做权限修改！");
		return false;
	}
	$.post(basepath+"/admin/role/mfun",{rid:rid, mids:ids}, function(data){
		if(data.state==200){
			layer.close(index);
			layer.msg("授权成功");
		}else{
			layer.close(index);
			layer.msg("授权异常");
		}
	},"json");
}